import {
	createRouter,
	createWebHistory
} from 'vue-router'
//import Home from '../views/Home.vue'
//import Shouye from '../views/shouye.vue'
//import Shapping from '../views/shapping.vue'

const routes = [
	{
		path: '',
		redirect: '/shouye'
	},
	//商品详情页路由
	{
		path: '/goodinfor',
		name: 'Goodinfor',
		component: () => import('../components/Goodinfor.vue')
	},
	//登录页路由
	{
		path: '/loginview',
		name: 'Loginview',
		component: () => import('../views/Loginview.vue')
	},
	//我的页路由
	{
		path: '/home',
		name: 'Home',
		component: () => import('../views/Home.vue'),
		children: [{
				path: 'Homechildrenone',
				component: () => import('../views/Homechildrenone.vue')
			},
			{
				path: 'Homechildrentwo',
				component: () => import('../views/Homechildrentwo.vue')
			}
		]
	},
	{
		path: '/about',
		name: 'About',
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () => import( /* webpackChunkName: "about" */ '../views/About.vue')
	},
	{
		path: '/shouye',
		name: 'shouye',
		component: () => import('../views/shouye.vue')
	},
	{
		path: '/shapping',
		name: 'shapping',
		component: () => import('../views/shapping.vue')
	}
]

const router = createRouter({
	history: createWebHistory(process.env.BASE_URL),
	routes
})

export default router
